package cn.cnsuh.q1025_divisorGame;

import java.util.Scanner;

/**
 * created by mzk on 2020/07/24
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        System.out.println(divisorGame(n));
    }

    static boolean divisorGame(int N) {
        boolean[] flag = new boolean[N + 5];
        flag[1] = false;
        flag[2] = true;
        for (int i = 3; i <= N; i++) {
            for (int j = 1; j < i; j++) {
                if (i % j == 0 && !flag[i - j]) {
                    flag[i] = true;
                    break;
                }
            }
        }
        return flag[N];
    }

    static boolean divisorGame1(int N) {
        return N % 2 == 0;
    }
}
